<admintpl file="header" />
<script type="text/javascript" src="public/js/My97DatePicker/WdatePicker.js?3"></script>

</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li ><a href="{:U('AdminFlow/recharge')}" target="_self">充值</a></li>
        <li class="active"><a href="{:U('AdminFlow/recharge_log')}" target="_self">充值记录</a></li>
    </ul>
    <form class="well form-search" method="post" action="{:U('AdminFlow/recharge_log')}" onsubmit="return check_form();">
        请选择时间：
        <input type="text" name="s_start_time" id="s_start_time" onclick="start_time()" style="width: 200px;" value="{$s_start_time}"/>至
        <input type="text" name="s_end_time" id="s_end_time" onclick="end_time()" style="width: 200px;"  value="{$s_end_time}"/>
        <input type="hidden" id="h_start_time" value="{$s_start_time}">
        <input type="hidden" id="h_end_time" value="{$s_end_time}">
        &nbsp;&nbsp;

    <input type="submit" class="btn btn-primary" value="搜索" />
    </form>
    <form class="js-ajax-form" action="" method="post">

        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <td>充值人员</td>
                <td>充值量(G)</td>
                <td>充值时间</td>
                <td>IP</td>
            </tr>
            </thead>
            <foreach name="list" item="vo">
                <tr>
                    <td>{$vo.user_nickname}</td>
                    <td>{$vo.flow_recharge_num}</td>
                    <td>{$vo.create_time}</td>
                    <td>{$vo.flow_recharge_ip}</td>
                </tr>
            </foreach>

        </table>

        <div class="pagination">{$page}</div>
    </form>
</div>
<script>

    function start_time(){
        WdatePicker({maxDate:"{$a}",onpicking:function(dp){
            $("#h_start_time").val(dp.cal.getNewDateStr());
        }
        });
    }
    function end_time(){
        WdatePicker({minDate:"{$b}",onpicking:function(dp){
            $("#h_end_time").val(dp.cal.getNewDateStr());
        }
        });
    }

    function check_form(){
        var h_start_time = $("#h_start_time").val();
        var h_end_time = $("#h_end_time").val();
        console.log(h_start_time);
        var start_arr = h_start_time.split("-");
        var end_arr = h_end_time.split("-");
        if(start_arr[0] == end_arr[0] && start_arr[1] == end_arr[1]){
            return true;
        }else{
            alert("查询日期必须在同一个月!");return false;
        }
    }

</script>
<script src="__PUBLIC__/js/common.js"></script>
<script>
    function refersh_window() {
        var refersh_time = getCookie('refersh_time');
        if (refersh_time == 1) {
            window.location = "{:U('AdminPost/index',$formget)}";
        }
    }

</script>
</body>
</html>